def mean(values):
    count = reduce(lambda x, y: x+y, values)
    n = float(len(values))
    return count / n

def median(values):
    ord_vals = sorted(values)
    n = len(ord_vals)
    if n % 2 == 1:
        i = n / 2
        return ord_vals[i]
    else:
        i = n / 2
        sum = ord_vals[i-1] + ord_vals[i]
        return sum / 2.0

def mid_range(values):
    sum = max(values) + min(values)
    return sum / 2.0
